<?php
namespace Lib;

class Nginx extends Model {
    protected $table = 'monitor.nginx';

    public function collect($baseUrl) {
        $url = $baseUrl . '/cfNginxView';

        if (!$info = collect($url)) {
            return false;
        }

        preg_match('/Active connections:\s+(\d+)/', $info, $r);

        return $r[1] ?? false;
    }

}
